home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / wgt / wgtfnt10 / fnttools.txt < prev    next >
Encoding:
Text File  |  1994-07-03  |  16.0 KB  |  374 lines

  1. These tools are contained in wgtfnt10.zip. They require
  2. a 80186 or higher CPU to execute and are to use from the DOS
  3. command line interpreter:
  4.  
  5.  
  6. COLORX:
  7.  
  8. COLORX is a color palette extractor for several bitmap file
  9. formats. COLORX supports BMP, GIF, LBM and PCX graphics
  10. formats.
  11.  
  12. FUNCTION:
  13. If a true color bitmap file format like PPM is used every
  14. pixel has its own RGB color triplet representing the color of
  15. the pixel. In indexed color formats like GIF every pixel is
  16. nothing else but an index to a color table holding the RGB
  17. triplets of the pixels. This color table can be sorted in
  18. various ways. Giving every pixel its own RGB triplet makes a
  19. color table unnecessary. Therefore the sorting within the
  20. color table is lost in a true color format. To preserve the
  21. sorting COLORX was made. COLORX writes a PPM compatible
  22. palette file (plain text/UNIX style) which can be used when
  23. converting a PPM font matrix to the indexed WGT .SPR format.
  24.  
  25. USAGE:
  26. COLORX srcfile.ext [destfile[.ext]] [-noscale]
  27.  
  28. If dest. file is left out dest. file name will be src. file 
  29. name with .PAL extension.
  30. If dest. extension is omitted dest. extension will be .PAL
  31. If dest. file already exists, COLORX overwrites the file.
  32.  
  33. -noscale: a rather unimportant option. Most bitmap file
  34. formats store R,G,B values ranging from (0,0,0) to
  35. (255,255,255). Of course a VGA card can't take that. Therefore
  36. the R,G,B values are automatically scaled to (0,0,0) -
  37. (63,63,63) by COLORX. If you don't want this scaling you can
  38. prevent it by setting the option -noscale.
  39.  
  40.  
  41. WPLTOPAL:
  42.  
  43. WPLTOPAL converts a WGT palette file into a PPM palette file.
  44.  
  45. FUNCTION:
  46. Use WPLTOPAL to convert a WGT palette file to a PPM palette file -
  47. the palette file format FNTTOSPR works with.
  48.  
  49. USAGE:
  50. WPLTOPAL srcfile[.ext] [destfile[.ext]]
  51.  
  52. If src. file extension is left out .WPL is used.
  53.  
  54. If dest. file name is omitted dest. file name will be src. file
  55. name with .PAL extension.
  56. If there is no dest. file name extension .PAL will be used.
  57. If dest. file already exists it will be overwritten.
  58.  
  59.  
  60. BMPTOPPM:
  61.  
  62. BMPTOPPM converts a OS/2 or Windows Bitmap to a Portable PixMap
  63. - the graphics file format used by the FNTTOSPR conversion
  64. utility.
  65.  
  66. FUNCTION:
  67. The FNTTOSPR font conversion utility delivered in this package
  68. requires a PPM file as input. However the PPM graphics format
  69. is not well known on the PC platform and is therefore only
  70. supported by a few programs. On the other hand the BMP
  71. graphics file format is very popular among PC users and there
  72. is a lot of software existing that converts almost any graphics
  73. file to the BMP format.
  74. BMPTOPPM can read OS/2 and Windows BMP files and convert them
  75. into the PPM format used by FNTTOSPR. BMPTOPPM can read the
  76. following BMP formats:
  77.  
  78. color depth (bits)    type        compression
  79. ===================================================
  80.       1            OS/2 PM 1.2    RGB
  81.       1            Windows 3.0    RGB
  82.       4            OS/2 PM 1.2    RGB
  83.       4            Windows 3.0    RGB
  84.       4            Windows 3.0    RLE4 *)
  85.       8            OS/2 PM 1.2    RGB
  86.       8            Windows 3.0    RGB
  87.       8            Windows 3.0    RLE8 *)
  88.      24            OS/2 PM 1.2    RGB **)
  89.      24            Windows 3.0    RGB **)
  90.  
  91. *) many programs can't compress bitmaps according to the RLE
  92.    compression scheme correctly. Therefore it is not
  93.    recommended to use this compression scheme when storing
  94.    bitmaps.
  95.  
  96. **) BMPTOPPM can convert true color bitmaps to the PPM format.
  97.     However if these true color bitmaps contain more than 256
  98.     colors (they usually do) FNTTOSPR will refuse to work with
  99.     them.
  100.  
  101. BMPTOPPM can process bitmaps with up to 4096x4096 pixels in
  102. size without using extended or expanded memory or a temporary
  103. file (Yeah! There is some black magic working for you).
  104.  
  105. USAGE:
  106. BMPTOPPM srcfile[.ext] [destfile[.ext]] [-debug]
  107.  
  108. If src. file extension is left out .BMP is used.
  109.  
  110. If dest. file is left out dest. file name will be src. file 
  111. name with .PPM extension.
  112. If dest. extension is omitted .PPM will be used.
  113. If dest. file already exists, BMPTOPPM will overwrite the file.
  114.  
  115. Options: -debug: displays some additional information about
  116.       the BMP bitmap file.
  117.  
  118.  
  119. FNTTOSPR:
  120.  
  121. FNTTOSPR converts a PPM pixmap which contains a font matrix
  122. into a WGT sprite file usable by the WGT sprite editor V4.0.
  123.  
  124. FUNCTION:
  125. FNTTOSPR is a font OCR software which can convert fixed and
  126. proportional width fonts into the WGT .SPR format. To use
  127. this program it is required to create a font matrix bitmap and
  128. save it as a PPM file. FNTTOSPR takes this PPM file and
  129. writes the font information inside it into a WGT sprite file
  130. which can be converted to a WGT font using the WGT sprite editor.
  131. The PPM pixmap which shall be converted may not have more than
  132. 256 colors - otherwise FNTTOSPR will fail. The upper left pixel
  133. of the PPM pixmap must have a color which is not being used in
  134. the font characters (= must have the background color). If a
  135. colormap is used color 0 (the first color in the PPM .PAL file)
  136. must be the background color.
  137. The font matrix bitmap you have to create must have a certain
  138. appearance. In principle it looks like this for fixed width
  139. fonts:
  140.  
  141. @ @|$
  142.  
  143. @ !"#$%&'()*+,-./ $
  144. @0123456789:;<=>? $
  145. @@ABCDEFGHIJKLMNO $
  146. @PQRSTUVWXYZ[\]^_ $
  147. @┤abcdefghijklmno $
  148. @pqrstuvwxyz{|}~  $
  149.  
  150. The first character line in a font matrix bitmap is the 'sync
  151. line'. It contains sync characters which are required for the
  152. font OCR process.
  153. The first character in a fixed width font sync line (the
  154. 'master sync') has to occupy (at least a part of) the leftmost
  155. column of the fixed font character matrix. The @ character in
  156. the Windows fixedSys font fullfills this condition. But you
  157. may have to use other characters for other fixed width fonts.
  158. The master sync has to be connected horizontally. For example
  159. " can never be a valid master sync since there is a gap
  160. between the two quotes.
  161. The next character in the sync line is always the space char.
  162. After the space char the master sync character has to follow.
  163. Following the 2nd master sync are two auxiliary sync chars:
  164. The first auxiliary sync character has to occupy (at least a
  165. part of) the bottom row of the fixed font character matrix.
  166. | does this in the Windows fixedSys font case.
  167. The second auxiliary sync has to occupy (at least a part of)
  168. the top row of the fixed font character matrix. $ does this in
  169. the Windows fixedSys font case.
  170. After the sync line leave one line blank.
  171. Now the font data lines follow. Each font data line begins
  172. with the master sync. Immediately after the master sync the
  173. character data follows. Each line has to contain 16 'data'
  174. characters. After the 16 data characters a space follows and
  175. after the space the auxiliary sync #2. The font data lines may
  176. not overlap. The data chars are stored in the font data lines
  177. in increasing ASCII code order - beginning from ASCII code
  178. 20h (SPACE char).
  179. You don't have to define always six font data lines. If a
  180. font only contains uppercase characters you may only define
  181. four font data lines for example.
  182. However there MUST be always 16 data chars in a font data line.
  183. If the last font data line contains less than 16 data
  184. characters fill it up with spaces so that the auxiliary sync #2
  185. is always at data character position 18. It is also required
  186. that the last font data line contains auxiliary sync #1. If
  187. it isn't there already put it after auxiliary sync #2 at data
  188. character position 19.
  189. FNTTOSPR is very sensitive to the appearance of the master
  190. sync. The master sync must always look the same in each font
  191. data line - otherwise FNTTOSPR will fail.
  192. Take a look at fixedsys.wri and fixedsys.bmp to become
  193. familiar with the conversion of fixed width fonts.
  194.  
  195. The font matrix bitmap for a proportional width font may look
  196. like this:
  197.  
  198. A A |$
  199.  
  200. A ! ' # $ % & ' ( ) * + , - . / $
  201. A 0 1 2 3 4 5 6 7 8 9 : ; < = > ? $
  202. A @ A B C D E F G H I J K L M N O $
  203. A P Q R S T U V W X Y Z [ \ ] ^ _ $
  204. A ┤ a b c d e f g h i j k l m n o $
  205. A p q r s t u v w x y z { | } ~ $
  206.  
  207. Note: In a proportional width font matrix ALL characters have
  208. to be connected horizontally. Take a look at the font data
  209. line #1. " is replaced by ' to fullfill this condition.
  210.  
  211. Again, the first line in the matrix is the 'sync line'. It
  212. holds special 'sync' characters which are required for the
  213. font OCR process. The first character in the sync line is the
  214. 'master sync'. For a proportional width font it is required
  215. that the x-spacing between two master syncs printed immediately
  216. after each other is 0 (this means: in this situation the
  217. master syncs should 'stick' together but should not overlap).
  218. 'A' fullfills this condition in the TrueType Arial font case.
  219. After the master sync the space character follows and again a
  220. master sync. The next two characters are the auxiliary syncs
  221. #1 and #2:
  222. The first auxiliary sync character has to occupy (at least a
  223. part of) the bottom row of the prop. font character matrix.
  224. | does this in the Windows TTF Arial font case.
  225. The second auxiliary sync has to occupy (at least a part of)
  226. the top row of the prop. font character matrix. $ does this in
  227. the Windows TTF Arial font case.
  228. After the sync line leave one line blank.
  229. Now the font data lines follow. Each font data line begins
  230. with a master sync. Then the character data follows. Note
  231. that there is a space between each character in the font data
  232. lines to prevent overlapping of characters. Each font data
  233. line must contain 16 data characters. After the 16 data chars
  234. follows the auxiliary sync #2. You will notice that font data
  235. line #1 contains only 15 data characters. This is due to the
  236. fact that the sync line's space character will be inserted by
  237. FNTTOSPR at the beginning of the first font data line - giving
  238. in summary 16 data characters for the 1st font data line as
  239. well. The font data lines may not overlap. The data chars are
  240. stored in the font data lines in increasing ASCII code order -
  241. beginning from ASCII code 21h ('!' char).
  242. You don't have to define always six font data lines. If a
  243. font only contains uppercase characters you may only define
  244. four font data lines for example.
  245. However there must be always 16 data chars in a font data line
  246. (except the font data line which would contain ASCII code 20h
  247. - the SPACE character. The space character will always be
  248. inserted from the sync line at logical font matrix/ASCII 
  249. code 20h. Therefore this line may only contain 15 data 
  250. chars).
  251. If the last font data line contains less than 16 data
  252. characters fill it up with auxiliary sync #2's so that it
  253. contains at least 16 data chars (- in this case count the
  254. auxiliary sync #2 as a data character). Also auxiliary sync #1
  255. has to appear in the last font data line. If it isn't there
  256. already put it after the last auxiliary sync #2 (of course you
  257. have to leave a space between auxiliary sync #2 and auxiliary
  258. sync #1).
  259. FNTTOSPR is very sensitive to the appearance of the master
  260. sync. The master sync must always look the same in each font 
  261. data line - otherwise FNTTOSPR will fail.
  262. Take a look at arial24.wri and arial24.bmp to become familiar
  263. with the conversion of proportional width fonts.
  264.  
  265. USAGE:
  266. FNTTOSPR srcfile[.ext] [destfile[.ext]] [@[colormap[.ext]]] [-option] [-option] ...
  267.  
  268. If src. file extension is left out .PPM / .PNM is used.
  269.  
  270. If dest. file name is left out src. file name will be used
  271. with .SPR extension.
  272. If dest. file extension is omitted .SPR will be used.
  273. If dest. file already exists FNTTOSPR will overwrite the file.
  274.  
  275. If no PPM colormap is specified, FNTTOSPR will create the
  276. index color table directly from the PPM file. This index
  277. color table is sorted by the first appearance of each color
  278. in the PPM file.
  279. If @ is found in the argument list without a colormap name
  280. src. file name will be used with .PAL extension as colormap
  281. file name.
  282. If a colormap file name is specified, but without extension,
  283. .PAL extension will be assumed.
  284. If a PPM colormap is specified FNTTOSPR will sort the colors
  285. of the font according to their order in the colormap. Using a
  286. colormap can slow down the conversion process significantly.
  287. COLORX can be used to extract a colormap of the processed font
  288. out of BMP, GIF, LBM and PCX files.
  289. Note: FNTTOSPR automatically optimizes the palette that is
  290. passed with the @ option. This means that two or more identical
  291. colors will be represented by only one color entry in the final
  292. sprite colormap.
  293.  
  294. Options: -debug: displays some additional information about
  295.       the font conversion process.
  296.      -fixed: instructs FNTTOSPR to create a fixed width
  297.       font. By default FNTTOSPR attempts to create a
  298.       proportional width font.
  299.      -starthh: hh stands for a hex value from 00-f0. This
  300.       option tells FNTTOSPR which ASCII code the first
  301.       data character in the first font data line has. If
  302.       you want to create a font which consists only of the
  303.       numbers 0-9 you naturally want to start from ASCII
  304.       code 30h which is the code for '0'. The default
  305.       start character (= first data font line, first data
  306.       character) is 20h (SPACE). Refer to ASCII code
  307.       tables for further information.
  308.      -spcdd,dd: dd stands for a decimal number from 0 to
  309.       99. You can add an artificial spacing between
  310.       characters by specifying this option. While not often
  311.       used with fixed width fonts it is required for
  312.       proportional width fonts to create a spacing between
  313.       the characters so that they do not stick together.
  314.       The first decimal value is the spacing in x direction,
  315.       the second decimal value of the option the spacing in
  316.       y direction. The default value for spacing in the x/y
  317.       direction is 0/0.
  318.       WGT version: If -spcdd,dd is used the artificial
  319.       spacing will be done in the background color (color 0)
  320.       unless the -coff option is found in the argument list.
  321.       If this is the case the spacing will be done in the
  322.       color passed with the -coff switch. If -zrz is active,
  323.       too it forces FNTTOSPR to do the spacing in color 0.
  324.      -lum: sort colors of the font by increasing luminance.
  325.       Color 0 will have the lowest luminance and color 255
  326.       the highest luminance (if the font has 256 colors).
  327.       If you are using this option the color with the
  328.       lowest luminance must be the background color of the
  329.       font matrix if FNTTOSPR should work properly.
  330.       This option can only be used in conjunction with
  331.       a PPM colormap which can be specified by @. If no
  332.       colormap for the PPM file is available the PPM
  333.       file itself can be used as a colormap (which takes
  334.       FNTTOSPR some time to compute).
  335.      -coffddd: ddd stands for a decimal value ranging from
  336.       0 to 255. This option is for use with graphic systems
  337.       that support local color palettes. In a local palette
  338.       graphics system every object has its own color property.
  339.       Think of a background picture transition from a jungle
  340.       to a river. The jungle background picture has its color
  341.       property of say 64 colors - the river background has a
  342.       64 color property as well. To transite smoothly between
  343.       the two backgrounds it is required that both color
  344.       palettes have different color index numbers - otherwise
  345.       the palette of the river would overwrite the palette
  346.       of the jungle and the picture would have a messy color
  347.       appearance. To assign both background pictures different
  348.       color index numbers use -coffddd with ddd as starting
  349.       color index number. Example:
  350.       To assign the jungle picture the colors 64-127 use
  351.       -coff64 for it.
  352.       To assign the river picture the colors 128-191 use
  353.       -coff128 for it.
  354.       The default -coff value is 0 - meaning no color
  355.       transition takes place.
  356.      -zrz: this option is used in conjunction with the -coff
  357.       switch. In some graphics systems color index 0 has a
  358.       special substance - as transparent color for example.
  359.       If this is the case it is most often not desired to
  360.       transition color 0 with the other colors when using the
  361.       -coff option. Adding the -zrz parameter leaves color 0
  362.       untouched while all other colors are transitioned.
  363.  
  364.  
  365. SHAREWARE LIMITATIONS:
  366. ----------------------
  367.  
  368. FNTTOSPR (Shareware):
  369. FNTTOSPR will convert max. 64 characters from a PPM font matrix
  370. pixmap to a WGT .SPR font. The -starthh option is disabled.
  371. FNTTOSPR will assume that the first data character to convert
  372. has the ASCII code 20h (SPACE).
  373.  
  374.